﻿

using System;
using System.Threading.Tasks;
using System.Linq.Expressions;

using Oliving.Edge.Model;
using Oliving.Edge.Model.Dto;
using Oliving.Edge.Model.Models;
using Oliving.Edge.IServices;
using Oliving.Edge.IRepository;
using Oliving.Edge.Services.BASE;
using Oliving.Edge.Model.Dto.XLT;
using Oliving.Edge.IRepository.XLT;
using Oliving.Edge.IServices.XLT;
using Oliving.Edge.Model.Models.XLT;
using Oliving.Edge.Model.Dto.Xcx;

namespace Oliving.Edge.Services.XLT
{
    public partial class CD_CleaningPointServices : BaseServices<CD_CleaningPoint>, ICD_CleaningPointServices
    {
        ICD_CleaningPointRepository _dal;
        public CD_CleaningPointServices(ICD_CleaningPointRepository dal)
        {
            this._dal = dal;
            base.BaseDal = dal;
        }



        public async Task<PageModel<CD_CleaningPointPageDto>> QueryPageList(
            Expression<Func<CD_CleaningPoint, bool>> whereExpression,
            int pageIndex = 1, int pageSize = 20,
            string sortField = null, string sortOrder = null
            )
        {
            var page = await _dal.QueryPageList(
                whereExpression,
                pageIndex, pageSize,
                    sortField, sortOrder);
            return page;
        }

        #region 根据扫码的保洁点ID 查询保洁点信息  白克平 2020-9-15
        /// <summary>
        ///  根据扫码的保洁点ID 查询保洁点信息
        ///  <author>白克平</author>
        ///  <datetime>2020-9-15</datetime>
        /// </summary>
        /// <param name="id">保洁点id</param>
        /// <returns></returns>

        public async Task<xCleaningPoint> QueryById(string id)
        {
            var data = await _dal.QueryById(id);
            return data;
        }
        #endregion

        #region 非保洁人员根据扫码的保洁点ID 查询保洁点信息  白克平 2020-9-15
        /// <summary>
        ///  非保洁人员根据扫码的保洁点ID 查询保洁点信息
        ///  <author>白克平</author>
        ///  <datetime>2020-9-15</datetime>
        /// </summary>
        /// <param name="id">保洁点id</param>
        /// <returns></returns>

        public async Task<FBjInfo> FQueryById(string id)
        {
            var data = await _dal.FQueryById(id);
            return data;
        }
        #endregion

        #region 保洁记录  白克平 2020-9-15
        /// <summary>
        ///  保洁记录 
        ///  <author>白克平</author>
        ///  <datetime>2020-9-15</datetime>
        /// </summary>
        /// <param name="whereExpression">条件</param>
        /// <param name="pageIndex">当前页</param>
        /// <param name="pageSize">条数</param>
        /// <returns></returns>
        public async Task<PageModel<FBjInfo>> GetPageList(Expression<Func<CD_CleaningRecord, bool>> whereExpression,
                int pageIndex = 1, int pageSize = 20)
        {
            var data = await _dal.GetPageList(whereExpression, pageIndex, pageSize);
            return data;
        }
        #endregion

    }
}

